import request from '@/utils/request'

// 获取心理老师列表
export function getTeachersList() {
  return request({
    url: '/system/teachers/list',
    method: 'get'
  })
}

// 获取老师的可预约时间表
export function getTeacherSchedule(teacherId) {
  return request({
    url: `/system/teachers/${teacherId}/schedule`,
    method: 'get'
  })
}

// 获取咨询方式列表
export function getConsultationMethods() {
  return request({
    url: '/system/consultation/methods',
    method: 'get'
  })
}

// 创建预约
export function createAppointment(data) {
  return request({
    url: '/system/appointments',
    method: 'post',
    data: data
  })
}

// 获取用户预约列表
export function getUserAppointments(params) {
  return request({
    url: '/system/appointments/user',
    method: 'get',
    params: params
  })
}

// 取消预约
export function cancelAppointment(appointmentId) {
  return request({
    url: `/system/appointments/${appointmentId}/cancel`,
    method: 'put'
  })
}

// 获取预约详情
export function getAppointmentDetail(appointmentId) {
  return request({
    url: `/system/appointments/${appointmentId}`,
    method: 'get'
  })
}